package com.ruoyi.web.controller.agoniappWeb;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.service.IAgoniEventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/pages/event")
public class EventWebController {

    @Autowired
    private IAgoniEventService agoniEventService;

    @GetMapping("/listEvents")
    public AjaxResult listEvents() {
        return  AjaxResult.success(agoniEventService.listEvents());
    }


    @GetMapping("/getEventsByFacilityId/{facilityId}")
    public AjaxResult getEventsByFacilityId(@PathVariable Long facilityId) {
        return AjaxResult.success(agoniEventService.getEventsByFacilityId(facilityId));
    }


}
